<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<div class="alert" id="alertContent">
	<button class="close" data-dismiss="alert">×</button>
	<center>
		<strong>Success!</strong><span>asd</span>
	</center>
</div>

<!-- 模态框（Modal） -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
					×
				</button>
				<h4 class="modal-title" id="myModalTitle">
					模态框（Modal）标题
				</h4>
			</div>
			<div class="modal-body" id="myModalBody">
				在这里添加一些文本
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭
				</button>
				<button type="button" class="btn btn-primary"  id="submitButton"> 
					提交
				</button>
			</div>
		</div><!-- /.modal-content -->
	</div><!-- /.modal -->
</div>

<input type="hidden"  id="modalResult" value=""/>
<input type="hidden"  id="modalUrl" value=""/>
<script>
	$("#alertContent").hide();
	function showSuccessAlert(text) {
		$("#alertContent").show();
		$('#alertContent').removeClass();
		$('#alertContent').addClass('alert alert-success');
		$('#alertContent strong').text('Success!');
		$('#alertContent span').text(text);
		$('#alertContent').show().delay(3000).hide(300);
	}
	function showWarningAlert(text) {
		$("#alertContent").show();
		$('#alertContent').removeClass();
		$('#alertContent').addClass('alert');
		$('#alertContent strong').text('Warning!');
		$('#alertContent span').text(text);
		$('#alertContent').show().delay(3000).hide(300);
	}
	function showErrorAlert() {
		$("#alertContent").show();
		$('#alertContent').removeClass();
		$('#alertContent').addClass('alert alert-error');
		$('#alertContent strong').text('Error!');
		$('#alertContent span').text("系统错误！请联系管理员！");
		$('#alertContent').show().delay(3000).hide(300);
	}
	function showModalMessage(title,content,url){
		 $('#myModal').modal('show');
		 $('#myModalTitle').text(title);
		 $('#myModalBody').text(content);
		 $('#modalUrl').val(url);
	}
	 
	 $('#submitButton').bind('click',function(){
		 var url = $('#modalUrl').val();
			window.location.href= url ;
	 });
</script>